
package cn.elwy.kit;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.CoolBar;
import org.eclipse.swt.widgets.CoolItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;

import cn.elwy.kit.file.dialog.BackupRecoveryFileDialog;
import cn.elwy.kit.file.dialog.FileRenameDialog;
import cn.elwy.kit.maven.MavenHandleDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;

public class KitPart {

	@Inject
	public KitPart() {

	}

	@PostConstruct
	public void postConstruct(final Composite parent) {
		parent.setLayout(new GridLayout(1, false));
		
				ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.RIGHT);
				toolBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
				
						ToolItem toolItem = new ToolItem(toolBar, SWT.NONE);
						toolItem.addSelectionListener(new SelectionAdapter() {
							@Override
							public void widgetSelected(SelectionEvent e) {
								BackupRecoveryFileDialog dialog = new BackupRecoveryFileDialog();
								dialog.open();
							}
						});
						toolItem.setText("解密");
						
								ToolItem tltmNewItem = new ToolItem(toolBar, SWT.NONE);
								tltmNewItem.addSelectionListener(new SelectionAdapter() {
									@Override
									public void widgetSelected(SelectionEvent e) {
										FileRenameDialog dialog = new FileRenameDialog(parent.getShell());
										dialog.open();
									}
								});
								tltmNewItem.setText("重命名");
								
										ToolItem tltmNewItem_1 = new ToolItem(toolBar, SWT.NONE);
										tltmNewItem_1.addSelectionListener(new SelectionAdapter() {
											@Override
											public void widgetSelected(SelectionEvent e) {
												MavenHandleDialog dialog = new MavenHandleDialog(parent.getShell());
												dialog.open();
											}
										});
										tltmNewItem_1.setText("Maven工具");

	}

}